/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.com.ces4.produccion.jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author usuario
 */
@Embeddable
public class ArticuloLineaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "NMLINEA", nullable = false)
    private int nmlinea;
    @Basic(optional = false)
    @Column(name = "DSARTICULO", nullable = false, length = 20)
    private String dsarticulo;

    public ArticuloLineaPK() {
    }

    public ArticuloLineaPK(int nmlinea, String dsarticulo) {
        this.nmlinea = nmlinea;
        this.dsarticulo = dsarticulo;
    }

    public int getNmlinea() {
        return nmlinea;
    }

    public void setNmlinea(int nmlinea) {
        this.nmlinea = nmlinea;
    }

    public String getDsarticulo() {
        return dsarticulo;
    }

    public void setDsarticulo(String dsarticulo) {
        this.dsarticulo = dsarticulo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) nmlinea;
        hash += (dsarticulo != null ? dsarticulo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ArticuloLineaPK)) {
            return false;
        }
        ArticuloLineaPK other = (ArticuloLineaPK) object;
        if (this.nmlinea != other.nmlinea) {
            return false;
        }
        if ((this.dsarticulo == null && other.dsarticulo != null) || (this.dsarticulo != null && !this.dsarticulo.equals(other.dsarticulo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.com.ces4.produccion.jpa.entities.ArticuloLineaPK[ nmlinea=" + nmlinea + ", dsarticulo=" + dsarticulo + " ]";
    }
    
}
